﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/Shared/_LayoutShow.cshtml";
   DTcms.Model.sites site = ViewData["site"] as DTcms.Model.sites;
   DTcms.Model.sysconfig config = ViewData["sysConfig"] as DTcms.Model.sysconfig;
   DTcms.Model.article m = ViewData["model"] as DTcms.Model.article;
   Article_ShowController bc = ViewBag.BasePage as Article_ShowController;
   string category_title = bc.get_category_title(m.category_id, "视频专区");
   ViewBag.Title = m.title + " - " + category_title + " - " + site.name;
   string channel = "video";
}
@section HeaderContent{
   <script src="~/scripts/cuplayer/js/swfobject.js"></script>
}
@section Scripts{
<script>
$(function(){
	//设置视频容器大小
	winResize();
	$(window).resize(function() {
		winResize();
	});
   //初始化视频容器
	initCUPlayer('@config.webpath', 'video-box', '@m.fields["video_src"]');
});
//改变大小函数
function winResize(){
	if($(".section").width() == 1180){
		$(".video-box").width(840);
		$(".video-box").height(473);
	}else{
		$(".video-box").width(601);
		$(".video-box").height(338);
	}
}
</script>
}

<!--当前位置-->
@{ string category_nav = bc.get_category_menu("video_list", m.category_id);}
<div class="section">
  <div class="location">
    <span>当前位置：</span>
    <a href="@bc.linkurl("index")">首页</a> &gt;
        <a href="@bc.linkurl("video")">视频专区</a>
    @Html.Raw(category_nav)
  </div>
</div>
<!--/当前位置-->

<div class="section">
  <!--/页面右边-->
  <div class="right-260">
    <div class="bg-wrap nobg">
      <div class="sidebar-box">
        <h4>阅读排行</h4>
        <ul class="txt-list">
          @{DataTable hotVideo = bc.get_article_list(channel, 0, 10, "status=0", "click desc,id desc");}
          @for (int i = 0; i < hotVideo.Rows.Count; i++) {
            DataRow hotdr = hotVideo.Rows[i];
            <li>
              @if (i == 0) {
                <label class="hot">@(i + 1)</label>
              }
              else {
                <label>@(i + 1)</label>
              }
              <a href="@bc.linkurl("video_show", hotdr["id"])">@hotdr["title"]</a>
            </li>
          }
        </ul>
      </div>
      <div class="sidebar-box">
        <h4>推荐视频</h4>
        <ul class="side-img-list">
          @{ DataTable redVideo = bc.get_article_list(channel, 0, 5, "status=0 and is_red=1");}
          @foreach (DataRow dr in redVideo.Rows) {
            <li>
              <div class="img-box">
                <a title="@dr["title"]" href="@bc.linkurl("video_show", dr["id"])">
                  <img src="@dr["img_url"]" /></a>
              </div>
              <div class="txt-box">
                <a title="@dr["title"]" href="@bc.linkurl("video_show", dr["id"])">@dr["title"]</a>
                <span>@dr["add_time"]</span>
              </div>
            </li>
          }
        </ul>
      </div>
    </div>
  </div>
  <!--/页面右边-->

  <!--页面左边-->
  <div class="left-auto">
    <div class="bg-wrap">
      <div class="meta">
        <h2>@m.title</h2>
        <div class="info">
          <span><i class="iconfont icon-date"></i>@m.add_time</span>
          <span><i class="iconfont icon-comment"></i>
            <script type="text/javascript" src="@(config.webpath)tools/submit_ajax.ashx?action=view_comment_count&channel_id=@m.channel_id&id=@m.id"></script>
            人评论</span>
          <span><i class="iconfont icon-view"></i>
            <script type="text/javascript" src="@(config.webpath)tools/submit_ajax.ashx?action=view_article_click&channel_id=@m.channel_id&id=@m.id&click=1"></script>
            次</span>
        </div>
      </div>

      <div id="video-box" class="video-box">
        <b>
          <img src="@(config.webpath)scripts/cuplayer/images/loading.gif" />视频加载中，请稍后...</b>
      </div>

      <div class="entry">
        @Html.Raw(m.content)
      </div>

      <!--上下一条-->
      <div class="next-box clearfix">
        <p class="prev">上一篇：@Html.Raw(bc.get_prevandnext_article("video_show", -1, "没有了", 0))</p>
        <p class="next">下一篇：@Html.Raw(bc.get_prevandnext_article("video_show", 1, "没有了", 0))</p>
      </div>
      <!--/上下一条-->

      <!--相关资讯-->
      <div class="rel-box">
        <h2 class="slide-tit">
          <span>相关资源</span>
        </h2>
        <ul class="rel-list">
          @{ DataTable relList = bc.get_article_list(channel, m.category_id, 4, "is_red=1 and id<>" + m.id);}
          @foreach (DataRow dr in relList.Rows) {
            <li>
              <div class="img-box">
                <a title="@dr["title"]" href="@bc.linkurl("video_show", dr["id"])">
                  <img src="@dr["img_url"]">
                </a>
              </div>
              <div class="info">
                <h3><a title="@dr["title"]" href="@bc.linkurl("video_show", dr["id"])">@dr["title"]</a></h3>
                <p>@dr["zhaiyao"]</p>
                <span>@dr["add_time"]</span>
              </div>
            </li>
          }
          @if (relList.Rows.Count < 1) {
            <div class="nodata">暂无相关数据...</div>
          }
        </ul>
      </div>
      <!--/相关资讯-->

      <!--网友评论-->
      @if (m.is_msg == 1) {
        <div class="comment-box">
          <h2 class="slide-tit">
            <strong>共有<script type="text/javascript" src="@(config.webpath)tools/submit_ajax.ashx?action=view_comment_count&channel_id=@m.channel_id&id=@m.id"></script>条评论</strong>
            <span>网友评论</span>
          </h2>
          @RenderPage("~/Areas/Web/Views/" + site.build_path + "/Shared/partial_comment_box.cshtml")
        </div>
      }
      <!--/网友评论-->
      
    </div>
  </div>
  <!--/页面左边-->
</div>
